<header class="p-3 border-bottom mb-3" style="background-color:#fafafd;">
    <div class="container">
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
            <a href="{% url 'blog:index' %}" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none" style="margin-right: 10px">
                <img src="{% static 'image/首义.jpg' %}" alt="" height="40px">
            </a>

            <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
                <li><a href="{% url 'blog:index' %}" class="nav-link px-2 text-secondary">首页</a></li>
                <li><a href="{% url 'blog:pub_blog' %}" class="nav-link px-2 text-secondary">发布博客</a></li>
            </ul>

            <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search" action="{% url 'blog:search' %}" method="GET">
                <input name="q" type="search" class="form-control form-control-light text-bg-light" placeholder="Search..." aria-label="Search">
            </form>

            {% if user.is_authenticated %}
                <div class="dropdown text-end">
                    <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                        <img src="{% static 'image/头像.jpg' %}" alt="mdo" width="32" height="32" class="rounded-circle">
                    </a>
                    <ul class="dropdown-menu text-small" style="">
                        <li><a class="dropdown-item" href="{% url 'blog_user:logout' %}">退出登录</a></li>
                        <li><a class="dropdown-item" href="{% url 'blog_user:myblog' %}">我的发布</a></li>
                    </ul>
                </div>
                </div>
                {% else %}
                <div class="text-end">
                    <a href="{% url 'blog_user:login' %}" type="button" class="btn btn-outline-primary me-2">登录</a>
                    <a href="{% url 'blog_user:register' %}" type="button" class="btn btn-primary">注册</a>
                </div>
            {% endif %}


        </div>
    </div>
</header>